(function(angular) {
	'use strict';
	angular.module('fs.waf').factory('categoryService', categoryService);
	categoryService.$inject = [ '$q', 'loggerFactory', 'commonService', 'ajaxServiceFactory'];
	function categoryService($q, loggerFactory, commonService, ajaxServiceFactory) {
		var log = loggerFactory.getLogger("categoryService"), ajaxService = ajaxServiceFactory.buildAjaxService({
			getCategoryTree : {
				url : 'do/cda/category/cate/getCategoryTree',
				method : 'get'
			}
		});
		
		function getCategoryTree() {
			var defer = $q.defer();
			ajaxService.getCategoryTree().then(function(response) {
				defer.resolve(response);
			});
			return defer.promise;
		}
		
		return {
			getCategoryTree : getCategoryTree
		};
	}
})(angular);